package com.sunwayworld.basemodule.common.asynctask.bean;

import com.alibaba.fastjson.annotation.JSONField;
import com.sunwayworld.framework.data.annotation.*;
import com.sunwayworld.framework.support.domain.AbstractInsertable;
import com.sunwayworld.framework.support.domain.Insertable;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

/**
 * 异步任务
 * 
 * @author zhangs@sunwayworld.com
 * @date 2022-10-11
 */
@Table("T_LIMS_ASYNCTASK")
public class LimsAsynctaskBean extends AbstractInsertable<Long> implements Insertable<Long> {

    @Transient
    private static final long serialVersionUID = -82566196618711043L;

    @Id
    private Long id;// 主键
    private String execStatus;// 执行状态
    @NotNull(defaultValue = "0")
    private Long execCount;// 执行次数
    @NotNull(defaultValue = "1")
    private Long execMaxCount;// 任务最大执行次数
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime execStartDate;// 执行开始时间
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime execEndDate;// 执行结束时间
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime joinedDate;// 入线程池的时间
    private String serverId;// 服务器ID
    @Clob
    private String errMsg;// 执行错误的内容
    private Long queueProgress;// 报告任务等待排队的位数
    private Long taskId;// 任务ID
    private String taskName;// 任务名称
    private String taskType; //任务类型，下拉框
    private String executorName;// 任务执行器名称
    private String jsonParam;// JSON格式的参数
    private String serviceMethod;// 调用方法
    private String taskNameDesc;// 任务描述
    private String taskNotify;// 是否提醒(0成功提醒,1失败提醒,2执行完提醒)
    @NotNull(defaultValue = "T_LIMS_ASYNCTASK")
    private String taskNotifyTemplateId;// 提醒模板ID
    private String createdById;// 制单人编码
    private String createdByName;// 制单人名称
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdTime;// 制单时间
    private String createdByOrgId;// 制单人单位编码
    private String createdByOrgName;// 制单人单位名称
    private String taskUserId;// 任务发起人ID
    private String taskUserName;// 任务发起人名称

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getExecStatus() {
        return execStatus;
    }

    public void setExecStatus(String execStatus) {
        this.execStatus = execStatus;
    }

    public Long getExecCount() {
        return execCount;
    }

    public void setExecCount(Long execCount) {
        this.execCount = execCount;
    }

    public LocalDateTime getExecStartDate() {
        return execStartDate;
    }

    public void setExecStartDate(LocalDateTime execStartDate) {
        this.execStartDate = execStartDate;
    }

    public LocalDateTime getExecEndDate() {
        return execEndDate;
    }

    public void setExecEndDate(LocalDateTime execEndDate) {
        this.execEndDate = execEndDate;
    }

    public LocalDateTime getJoinedDate() {
        return joinedDate;
    }

    public void setJoinedDate(LocalDateTime joinedDate) {
        this.joinedDate = joinedDate;
    }

    public String getServerId() {
        return serverId;
    }

    public void setServerId(String serverId) {
        this.serverId = serverId;
    }

    public String getErrMsg() {
        return errMsg;
    }

    public void setErrMsg(String errMsg) {
        this.errMsg = errMsg;
    }

    public Long getQueueProgress() {
        return queueProgress;
    }

    public void setQueueProgress(Long queueProgress) {
        this.queueProgress = queueProgress;
    }

    public Long getTaskId() {
        return taskId;
    }

    public void setTaskId(Long taskId) {
        this.taskId = taskId;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    public String getExecutorName() {
        return executorName;
    }

    public void setExecutorName(String executorName) {
        this.executorName = executorName;
    }

    public String getJsonParam() {
        return jsonParam;
    }

    public void setJsonParam(String jsonParam) {
        this.jsonParam = jsonParam;
    }

    public String getServiceMethod() {
        return serviceMethod;
    }

    public void setServiceMethod(String serviceMethod) {
        this.serviceMethod = serviceMethod;
    }

    public String getTaskNameDesc() {
        return taskNameDesc;
    }

    public void setTaskNameDesc(String taskNameDesc) {
        this.taskNameDesc = taskNameDesc;
    }

    public String getTaskNotify() {
        return taskNotify;
    }

    public void setTaskNotify(String taskNotify) {
        this.taskNotify = taskNotify;
    }

    public String getTaskNotifyTemplateId() {
        return taskNotifyTemplateId;
    }

    public void setTaskNotifyTemplateId(String taskNotifyTemplateId) {
        this.taskNotifyTemplateId = taskNotifyTemplateId;
    }

    public String getCreatedById() {
        return createdById;
    }

    public void setCreatedById(String createdById) {
        this.createdById = createdById;
    }

    public String getCreatedByName() {
        return createdByName;
    }

    public void setCreatedByName(String createdByName) {
        this.createdByName = createdByName;
    }

    public LocalDateTime getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(LocalDateTime createdTime) {
        this.createdTime = createdTime;
    }

    public String getCreatedByOrgId() {
        return createdByOrgId;
    }

    public void setCreatedByOrgId(String createdByOrgId) {
        this.createdByOrgId = createdByOrgId;
    }

    public String getCreatedByOrgName() {
        return createdByOrgName;
    }

    public void setCreatedByOrgName(String createdByOrgName) {
        this.createdByOrgName = createdByOrgName;
    }

    public String getTaskUserId() {
        return taskUserId;
    }

    public void setTaskUserId(String taskUserId) {
        this.taskUserId = taskUserId;
    }

    public String getTaskUserName() {
        return taskUserName;
    }

    public void setTaskUserName(String taskUserName) {
        this.taskUserName = taskUserName;
    }

    public String getTaskType() {
        return taskType;
    }

    public void setTaskType(String taskType) {
        this.taskType = taskType;
    }

    public Long getExecMaxCount() {
        return execMaxCount;
    }

    public void setExecMaxCount(Long execMaxCount) {
        this.execMaxCount = execMaxCount;
    }
}
